package com.bnz.controller;

import com.bnz.pojo.R;

import com.bnz.pojo.Student;
import com.bnz.service.IStudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RequestMapping("/student")
@RestController
public class StudentController {
    @Autowired
    private IStudentService studentService;
    @GetMapping("/list")
    public R findAll(){
       List<Student> students = studentService.list();
       return R.ok().data("students",students);
    }
}
